package calculadoraplugin.actions;

import java.awt.Color;
import java.awt.Component;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.Border;

import org.eclipse.wb.swing.FocusTraversalOnArray;

public class Calculadora extends JFrame {
	private static final long serialVersionUID = -6206769323093148645L;

	// private Panel
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			@Override
			public void run() {
				try {
					Calculadora frame = new Calculadora();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Calculadora() {
		setSize(343, 300);
		setType(Type.UTILITY);
		setTitle("Calculadora");
		setIconImage(Toolkit
				.getDefaultToolkit()
				.getImage(
						"D:\\Programacion Java\\calculadoraPlugin\\icons\\calculator.png"));
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBackground(new Color(102, 255, 102));
		setAutoRequestFocus(false);
		getContentPane().setBackground(new Color(153, 255, 153));

		JTextArea textArea = new JTextArea(1, 20);
		textArea.setEnabled(false);
		textArea.setEditable(false);
		Border border = BorderFactory.createLineBorder(Color.BLACK);
		textArea.setBorder(border);

		JButton btnNewButton = new JButton("1");

		JButton button = new JButton("2");

		JButton btnBoton4 = new JButton("4");

		JButton btnBoton7 = new JButton("7");
		btnBoton7.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
			}
		});

		JButton button_3 = new JButton("5");

		JButton button_4 = new JButton("8");

		JButton btnBotonMas = new JButton("+/-");

		JButton btnBoton0 = new JButton("0");

		JButton button_7 = new JButton("3");

		JButton button_8 = new JButton("6");

		JButton button_9 = new JButton("9");

		JButton btnBotonComa = new JButton(",");

		JButton btnNewButton_1 = new JButton("+");

		JButton button_11 = new JButton("-");

		JButton button_12 = new JButton("*");

		JButton button_13 = new JButton("/");

		JButton btnNewButton_2 = new JButton("=");

		JButton btnC = new JButton("C");

		JButton btnCe = new JButton("CE");
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout
				.setHorizontalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addContainerGap()
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																textArea,
																GroupLayout.DEFAULT_SIZE,
																315,
																Short.MAX_VALUE)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.LEADING)
																						.addGroup(
																								groupLayout
																										.createParallelGroup(
																												Alignment.TRAILING,
																												false)
																										.addComponent(
																												btnBoton4,
																												Alignment.LEADING,
																												GroupLayout.DEFAULT_SIZE,
																												GroupLayout.DEFAULT_SIZE,
																												Short.MAX_VALUE)
																										.addComponent(
																												btnBoton7,
																												Alignment.LEADING,
																												GroupLayout.DEFAULT_SIZE,
																												51,
																												Short.MAX_VALUE)
																										.addComponent(
																												btnBotonMas,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE))
																						.addComponent(
																								btnNewButton,
																								GroupLayout.PREFERRED_SIZE,
																								51,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				ComponentPlacement.RELATED)
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.LEADING,
																								false)
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addComponent(
																												btnBoton0,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												btnBotonComa,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												btnNewButton_1,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addComponent(
																												button_4,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												button_9,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE)
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												button_11,
																												GroupLayout.PREFERRED_SIZE,
																												51,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createParallelGroup(
																												Alignment.TRAILING)
																										.addGroup(
																												Alignment.LEADING,
																												groupLayout
																														.createSequentialGroup()
																														.addComponent(
																																button,
																																GroupLayout.PREFERRED_SIZE,
																																51,
																																GroupLayout.PREFERRED_SIZE)
																														.addPreferredGap(
																																ComponentPlacement.RELATED)
																														.addComponent(
																																button_7,
																																GroupLayout.PREFERRED_SIZE,
																																51,
																																GroupLayout.PREFERRED_SIZE)
																														.addPreferredGap(
																																ComponentPlacement.RELATED)
																														.addComponent(
																																button_13,
																																GroupLayout.PREFERRED_SIZE,
																																51,
																																GroupLayout.PREFERRED_SIZE))
																										.addGroup(
																												Alignment.LEADING,
																												groupLayout
																														.createSequentialGroup()
																														.addComponent(
																																button_3,
																																GroupLayout.PREFERRED_SIZE,
																																51,
																																GroupLayout.PREFERRED_SIZE)
																														.addPreferredGap(
																																ComponentPlacement.RELATED)
																														.addComponent(
																																button_8,
																																GroupLayout.PREFERRED_SIZE,
																																51,
																																GroupLayout.PREFERRED_SIZE)
																														.addPreferredGap(
																																ComponentPlacement.RELATED)
																														.addComponent(
																																button_12,
																																GroupLayout.PREFERRED_SIZE,
																																51,
																																GroupLayout.PREFERRED_SIZE))))
																		.addPreferredGap(
																				ComponentPlacement.RELATED,
																				13,
																				Short.MAX_VALUE)
																		.addComponent(
																				btnNewButton_2,
																				GroupLayout.DEFAULT_SIZE,
																				80,
																				Short.MAX_VALUE)
																		.addPreferredGap(
																				ComponentPlacement.RELATED)))
										.addGap(10))
						.addGroup(
								Alignment.TRAILING,
								groupLayout
										.createSequentialGroup()
										.addContainerGap(213, Short.MAX_VALUE)
										.addComponent(btnCe,
												GroupLayout.PREFERRED_SIZE, 51,
												GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												ComponentPlacement.UNRELATED)
										.addComponent(btnC,
												GroupLayout.PREFERRED_SIZE, 51,
												GroupLayout.PREFERRED_SIZE)
										.addContainerGap()));
		groupLayout
				.setVerticalGroup(groupLayout
						.createParallelGroup(Alignment.LEADING)
						.addGroup(
								groupLayout
										.createSequentialGroup()
										.addContainerGap()
										.addComponent(textArea,
												GroupLayout.PREFERRED_SIZE, 34,
												GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												ComponentPlacement.RELATED)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addComponent(
																btnC,
																GroupLayout.PREFERRED_SIZE,
																35,
																GroupLayout.PREFERRED_SIZE)
														.addComponent(
																btnCe,
																GroupLayout.PREFERRED_SIZE,
																35,
																GroupLayout.PREFERRED_SIZE))
										.addGap(9)
										.addGroup(
												groupLayout
														.createParallelGroup(
																Alignment.LEADING)
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addPreferredGap(
																				ComponentPlacement.RELATED)
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.BASELINE)
																						.addComponent(
																								btnNewButton,
																								GroupLayout.PREFERRED_SIZE,
																								35,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								button,
																								GroupLayout.DEFAULT_SIZE,
																								35,
																								Short.MAX_VALUE)
																						.addComponent(
																								button_7,
																								GroupLayout.PREFERRED_SIZE,
																								35,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								button_13,
																								GroupLayout.PREFERRED_SIZE,
																								35,
																								GroupLayout.PREFERRED_SIZE))
																		.addPreferredGap(
																				ComponentPlacement.RELATED)
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.TRAILING)
																						.addGroup(
																								groupLayout
																										.createSequentialGroup()
																										.addGroup(
																												groupLayout
																														.createParallelGroup(
																																Alignment.BASELINE)
																														.addComponent(
																																btnBoton4,
																																GroupLayout.PREFERRED_SIZE,
																																35,
																																GroupLayout.PREFERRED_SIZE)
																														.addComponent(
																																button_3,
																																GroupLayout.PREFERRED_SIZE,
																																35,
																																GroupLayout.PREFERRED_SIZE)
																														.addComponent(
																																button_8,
																																GroupLayout.PREFERRED_SIZE,
																																35,
																																GroupLayout.PREFERRED_SIZE)
																														.addComponent(
																																button_12,
																																GroupLayout.PREFERRED_SIZE,
																																35,
																																GroupLayout.PREFERRED_SIZE))
																										.addPreferredGap(
																												ComponentPlacement.RELATED)
																										.addComponent(
																												btnBoton7,
																												GroupLayout.PREFERRED_SIZE,
																												35,
																												GroupLayout.PREFERRED_SIZE))
																						.addGroup(
																								groupLayout
																										.createParallelGroup(
																												Alignment.BASELINE)
																										.addComponent(
																												button_9,
																												GroupLayout.PREFERRED_SIZE,
																												35,
																												GroupLayout.PREFERRED_SIZE)
																										.addComponent(
																												button_4,
																												GroupLayout.PREFERRED_SIZE,
																												35,
																												GroupLayout.PREFERRED_SIZE)
																										.addComponent(
																												button_11,
																												GroupLayout.PREFERRED_SIZE,
																												35,
																												GroupLayout.PREFERRED_SIZE)))
																		.addPreferredGap(
																				ComponentPlacement.RELATED)
																		.addGroup(
																				groupLayout
																						.createParallelGroup(
																								Alignment.BASELINE)
																						.addComponent(
																								btnNewButton_1,
																								GroupLayout.PREFERRED_SIZE,
																								35,
																								GroupLayout.PREFERRED_SIZE)
																						.addComponent(
																								btnBotonComa,
																								GroupLayout.DEFAULT_SIZE,
																								35,
																								Short.MAX_VALUE)
																						.addComponent(
																								btnBoton0,
																								GroupLayout.DEFAULT_SIZE,
																								35,
																								Short.MAX_VALUE)
																						.addComponent(
																								btnBotonMas,
																								GroupLayout.PREFERRED_SIZE,
																								35,
																								GroupLayout.PREFERRED_SIZE)))
														.addGroup(
																groupLayout
																		.createSequentialGroup()
																		.addPreferredGap(
																				ComponentPlacement.UNRELATED)
																		.addComponent(
																				btnNewButton_2,
																				GroupLayout.PREFERRED_SIZE,
																				162,
																				GroupLayout.PREFERRED_SIZE)))
										.addContainerGap()));
		getContentPane().setLayout(groupLayout);
		getContentPane().setFocusTraversalPolicy(
				new FocusTraversalOnArray(new Component[] { btnNewButton,
						button, button_7, btnBoton4, button_3, button_8,
						btnBoton7, button_4, button_9, btnBotonMas, btnBoton0,
						btnBotonComa, textArea }));

		/*
		 * Group group = new Group(shlCalculadora, SWT.NONE);
		 * group.setBounds(20, 88, 125, 135);
		 * 
		 * Button btnNumero1 = new Button(group, SWT.NONE);
		 * btnNumero1.addSelectionListener(new SelectionAdapter() {
		 * 
		 * @Override public void widgetSelected(SelectionEvent e) {
		 * System.out.println("Hola"); } }); btnNumero1
		 * .setFont(SWTResourceManager.getFont("Tahoma", 11, SWT.NORMAL));
		 * btnNumero1.setBounds(10, 21, 30, 23); btnNumero1.setText("1");
		 * 
		 * Button btnNumero2 = new Button(group, SWT.NONE);
		 * btnNumero2.addSelectionListener(new SelectionAdapter() {
		 * 
		 * @Override public void widgetSelected(SelectionEvent e) { } });
		 * btnNumero2 .setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); btnNumero2.setBounds(46, 21, 30, 23);
		 * btnNumero2.setText("2");
		 * 
		 * Button btnNewButton_1 = new Button(group, SWT.NONE);
		 * btnNewButton_1.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); btnNewButton_1.setBounds(86, 21, 30, 23);
		 * btnNewButton_1.setText("3");
		 * 
		 * Button button_1 = new Button(group, SWT.NONE);
		 * button_1.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_1.setBounds(10, 51, 30, 23);
		 * button_1.setText("4");
		 * 
		 * Button btnNewButton_2 = new Button(group, SWT.NONE);
		 * btnNewButton_2.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); btnNewButton_2.setBounds(46, 51, 30, 23);
		 * btnNewButton_2.setText("5");
		 * 
		 * Button button_2 = new Button(group, SWT.NONE);
		 * button_2.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_2.setBounds(86, 50, 30, 23);
		 * button_2.setText("6");
		 * 
		 * Button button_3 = new Button(group, SWT.NONE);
		 * button_3.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_3.setBounds(10, 80, 30, 23);
		 * button_3.setText("7");
		 * 
		 * Button button_4 = new Button(group, SWT.NONE);
		 * button_4.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_4.setText("8"); button_4.setBounds(46, 80, 30,
		 * 23);
		 * 
		 * Button button_5 = new Button(group, SWT.NONE);
		 * button_5.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_5.setText("9"); button_5.setBounds(86, 79, 30,
		 * 24);
		 * 
		 * Button button_6 = new Button(group, SWT.NONE);
		 * button_6.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_6.setText("0"); button_6.setBounds(10, 109, 30,
		 * 23);
		 * 
		 * Button button_7 = new Button(group, SWT.NONE);
		 * button_7.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_7.setText(","); button_7.setBounds(86, 109, 30,
		 * 23);
		 * 
		 * Button button_12 = new Button(group, SWT.NONE);
		 * button_12.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_12.setText("+/-"); button_12.setBounds(46, 109,
		 * 30, 23); group.setTabList(new Control[] { btnNumero1, btnNumero2,
		 * btnNewButton_1, button_1, btnNewButton_2, button_2, button_3,
		 * button_4, button_5, button_6, button_12, button_7 });
		 * 
		 * Group group_1 = new Group(shlCalculadora, SWT.NONE);
		 * group_1.setBounds(151, 88, 136, 137);
		 * 
		 * Button btnNewButton_3 = new Button(group_1, SWT.NONE);
		 * btnNewButton_3.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); btnNewButton_3.setBounds(10, 24, 68, 23);
		 * btnNewButton_3.setText("/");
		 * 
		 * Button button_8 = new Button(group_1, SWT.NONE);
		 * button_8.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_8.setText("*"); button_8.setBounds(10, 53, 68,
		 * 23);
		 * 
		 * JButton button_9 = new JButton(group_1, SWT.NONE);
		 * button_9.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_9.setText("-"); button_9.setBounds(10, 82, 68,
		 * 23);
		 * 
		 * Button button_10 = new Button(group_1, SWT.NONE);
		 * button_10.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_10.setText("+"); button_10.setBounds(10, 111,
		 * 68, 23);
		 * 
		 * Button button_11 = new Button(group_1, SWT.NONE);
		 * button_11.setFont(SWTResourceManager.getFont("Tahoma", 11,
		 * SWT.NORMAL)); button_11.setText("="); button_11.setBounds(85, 24, 41,
		 * 110);
		 * 
		 * Group group_2 = new Group(shlCalculadora, SWT.NONE);
		 * group_2.setBounds(20, 35, 267, 47);
		 * 
		 * Button btnCe = new Button(group_2, SWT.NONE);
		 * btnCe.setFont(SWTResourceManager.getFont("Tahoma", 11, SWT.NORMAL));
		 * btnCe.setText("CE"); btnCe.setBounds(187, 14, 30, 23);
		 * 
		 * Button btnC = new Button(group_2, SWT.NONE);
		 * btnC.setFont(SWTResourceManager.getFont("Tahoma", 11, SWT.NORMAL));
		 * btnC.setText("C"); btnC.setBounds(227, 14, 30, 23);
		 * group_2.setTabList(new Control[] { btnC, btnCe });
		 */
	}
}
